//
//  AppsBaseViewController.m
//  GDPU_Bible
//
//  Created by Vescky on 13-5-31.
//  Copyright (c) 2013年 gdpuDeveloper. All rights reserved.
//

#import "AppsBaseTableViewController.h"

@implementation AppsBaseTableViewController

@synthesize tbView;

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //初始化刷新view
    _header = [MJRefreshHeaderView header];
    _header.scrollView = tbView;
    _header.delegate = self;
    
    // 4.3行集成上拉加载更多控件
    _footer = [MJRefreshFooterView footer];
    _footer.scrollView = tbView;
    _footer.delegate = self;
}

#pragma mark - 刷新的代理方法---进入下拉刷新\上拉加载更多都有可能调用这个方法
- (void)refreshViewBeginRefreshing:(MJRefreshBaseView *)refreshView
{
    if (refreshView == _header) {
        // 下拉刷新
        [self refreshData];
    }
    else {
        //上拉加载更多
        [self loadMoreData];
    }
}

- (void)refreshData {
    NSLog(@"refresh data");
}

- (void)loadMoreData {
    NSLog(@"load more data");
}

- (void)endRefreshing {
    [_header endRefreshing];
    [_footer endRefreshing];
}

@end
